package com.j1ay.forum.utils;

import com.j1ay.forum.model.pojo.po.User;

/**
 * @Author J1ay
 * @Date 2021/12/17 13:45
 * @Description
 */

public class UserThreadLocal {

    private UserThreadLocal() {}

    private static final ThreadLocal<User> LOCAL = new ThreadLocal<>();

    public static void put(User user) {
        LOCAL.set(user);
    }

    public static User get() {
        return LOCAL.get();
    }

    public static void remove() {
        LOCAL.remove();
    }
}
